<?php

  /************************************************************\
  *
  *	  wordCloud Copyright 2007 Derek Harvey
  *	  www.lotsofcode.com
  *
  *	  This file is part of wordCloud.
  *
  *	  wordCloud is free software; you can redistribute it and/or modify
  *	  it under the terms of the GNU General Public License as published by
  *	  the Free Software Foundation; either version 2 of the License, or
  *	  (at your option) any later version.
  *
  *	  wordCloud is distributed in the hope that it will be useful,
  *	  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *	  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
  *	  GNU General Public License for more details.
  *
  *	  You should have received a copy of the GNU General Public License
  *	  along with wordCloud; if not, write to the Free Software
  *	  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA	02111-1307	USA
  *
  \************************************************************/
  
  require 'classes/wordcloud.class.php';
  
?>
      <?php
        // Initite the basic object
        $cloud = new wordCloud();
        // Basic Add Option
        $cloud->addWord('php');
        $cloud->addWord('google');
        $cloud->addWord('digg');
        $cloud->addWord('lotsofcode');
        // Advanced Add Option
        $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com'));
        $cloud->addWord(array('word' => 'google', 'size' => 1, 'url' => 'http://www.lotsofcode.com'));
        echo $cloud->showCloud();
      ?>

     <?php
        $cloud = new wordCloud();
        $cloud->addString('lotsofcode lotsofcode lotsofcode have developed a tag cloud that contains keywords found ');
        echo $cloud->showCloud();
      ?>


       <?php
          // Initite the basic object
          $cloud = new wordCloud();
          $cloud->addWord(array('word' => 'php', 'size' => 1, 'url' => 'http://www.php.net'));
          $cloud->addWord(array('word' => 'google', 'size' => 2, 'url' => 'http://www.google.com'));
          $cloud->addWord(array('word' => 'digg', 'size' => 3, 'url' => 'http://digg.com'));
          $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com'));
          $myCloud = $cloud->showCloud('array');
          foreach ($myCloud as $cloudArray) {
            echo ' &nbsp; <a href="'.$cloudArray['url'].'" class="word size'.$cloudArray['range'].'">'.$cloudArray['word'].'</a> &nbsp;';
          }	
        ?>

        <?php
          // Initite the basic object
          $cloud = new wordCloud();
          $cloud->addWord(array('word' => 'php', 'size' => 1, 'url' => 'http://www.php.net', 'colour' => '#FF0000'));
          $cloud->addWord(array('word' => 'google', 'size' => 2, 'url' => 'http://www.google.com', 'colour' => '#00FF00'));
          $cloud->addWord(array('word' => 'digg', 'size' => 3, 'url' => 'http://digg.com', 'colour' => '#0000FF'));
          $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com', 'colour' => '#FFFF00'));
          $myCloud = $cloud->showCloud('array');
          foreach ($myCloud as $cloudArray) {
            echo ' &nbsp; <span style="color: '.$cloudArray['colour'].';" class="word size'.$cloudArray['range'].'">'.$cloudArray['word'].'</span> &nbsp;';
          }	
        ?>
   <?php
          // Initite the basic object
          $cloud = new wordCloud();
          $cloud->addWord(array('word' => 'php', 'size' => 1, 'url' => 'http://www.php.net', 'colour' => '#FF0000'));
          $cloud->addWord(array('word' => 'google', 'size' => 2, 'url' => 'http://www.google.com', 'colour' => '#00FF00'));
          $cloud->addWord(array('word' => 'digg', 'size' => 3, 'url' => 'http://digg.com', 'colour' => '#0000FF'));
          $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com', 'colour' => '#FFFF00'));
          $myCloud = $cloud->showCloud('array');
          foreach ($myCloud as $cloudArray) {
            echo ' &nbsp; <a href="'.$cloudArray['url'].'" style="color: '.$cloudArray['colour'].';" class="word size'.$cloudArray['range'].'">'.$cloudArray['word'].'</a> &nbsp;';
          }	
        ?>
        <?php
          // Initite the basic object
          $cloud = new wordCloud();
          $cloud->addWord(array('word' => 'php', 'size' => 1, 'url' => 'http://www.php.net', 'colour' => '#FF0000'));
          $cloud->addWord(array('word' => 'google', 'size' => 2, 'url' => 'http://www.google.com', 'colour' => '#00FF00'));
          $cloud->addWord(array('word' => 'digg', 'size' => 3, 'url' => 'http://digg.com', 'colour' => '#0000FF'));
          $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com', 'colour' => '#FFFF00'));
          $cloud->setLimit(2);
          echo $cloud->showCloud();	
        ?>
      
      <?php
        // Initite the basic object
        $cloud = new wordCloud();
        // Basic Add Option
        $cloud->addWord('php');
        $cloud->addWord('google');
        $cloud->addWord('digg');
        $cloud->addWord('lotsofcode');
        // Advanced Add Option
        $cloud->orderBy('size', 'desc'); // Add Order to the cloud
        echo $cloud->showCloud();
      ?>
        <?php
          // Initite the basic object
          $cloud = new wordCloud();
          $cloud->addWord(array('word' => 'php', 'size' => 1, 'url' => 'http://www.php.net', 'colour' => '#FF0000'));
          $cloud->addWord(array('word' => 'google', 'size' => 2, 'url' => 'http://www.google.com', 'colour' => '#00FF00'));
          $cloud->addWord(array('word' => 'digg', 'size' => 3, 'url' => 'http://digg.com', 'colour' => '#0000FF'));
          $cloud->addWord(array('word' => 'lotsofcode', 'size' => 4, 'url' => 'http://www.lotsofcode.com', 'colour' => '#FFFF00'));
          $cloud->removeWord('digg');
          $cloud->removeWord('google');
          echo $cloud->showCloud();	
        ?>

